<template>
  <div class="my-button-group">
    <my-button
      v-for="item of regulars"
      :key="item.regular"
      :type="type"
      @click.native="setCurrent(item.regular)"
      :active="current === item.regular"
    >{{item.text}}</my-button>
  </div>
</template>

<script>
import MyButton from './MyButton.vue'
export default {
  name: 'MyButtonGroup',
  components: {
    MyButton
  },
  props: {
    regulars: Array,
    type: {
      type: String,
      default: 'primary'
    },
    current: String
    
  },
  methods: {
    setCurrent(value) {
      this.$emit('click', value)
    }
  }
  
}
</script>

<style lang="less" scope>
  .my-button-group {
    display: inline-block;
  }
</style>